<template>
  <div class="erzi">
    <h2>关于祖孙传递值的试验 {{stu.name}} ~~{{stu.age}} </h2>
    <Sunzi/>
  </div>
</template>

<script>
import Sunzi from "./Sunzi.vue";
import {inject} from "vue";
export default {
  name: "Erzi",
  components: {Sunzi},
  setup(){
    let stu=inject("stu")
    return{
      stu
    }
  }
}
</script>

<style scoped>
  .erzi{
    background-color: #ae3ae3;
    padding: 10px;
  }
</style>